<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import = "com.classes.Casemast, java.util.ArrayList, java.util.TreeMap, org.owasp.encoder.Encode" %>
<%@ page import = "com.mbbmap.security.dao.*" %>
<%@ include file="/jsp/map/include/user-dao.jsp" %>	
<%@page import="com.mbbmap.util.EncryptionHelper"%>
<%

TreeMap<String, String> search = (TreeMap<String, String>) request.getAttribute("search");

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<jsp:include page="/jsp/map/include/html-meta.jsp" />
<title>MAYBANK</title>
<script src="<%= request.getContextPath() %>/js/report.js"></script>
</head>

<body onload="report.report_init();">

<!-- Header -->
<%@ include file="/jsp/common/Header.jsp" %>	
<!-- End Header -->


<div class="row-fluid page">
	<div class="span12">
		
		<jsp:include page="/jsp/map/include/report-nav.jsp">
			<jsp:param name="report_title" value='<%=EncryptionHelper.encrypt("Processing Productivity Report") %>' />
		</jsp:include>

		<form name="search_form" method="post" action="<%= request.getContextPath() + "/Report.do?dispatch=processing_productivity_report" %>" onsubmit="return report.search_status_validate();">
			<div class="row-fluid form-horizontal search">
				<div class="span6">
					
					<div class="control-group">
						<label class="control-label">Monthly</label>
						<div class="controls">
							<%
							String html = "";
							if(search.containsKey("year")){
								html = search.get("year");
							}
							%>
							<input type="text" id="year" name="year" placeholder="eg. 2015" value="<%= html %>" />
							
							<select id="month" name="month">
							<% 
								html = "<option value=\"\"></option>"
									+ "<option value=\"01\">JANUARY</option>"
									+ "<option value=\"02\">FEBRUARY</option>"
									+ "<option value=\"03\">MARCH</option>"
									+ "<option value=\"04\">APRIL</option>"
									+ "<option value=\"05\">MAY</option>"
									+ "<option value=\"06\">JUNE</option>"
									+ "<option value=\"07\">JULY</option>"
									+ "<option value=\"08\">AUGUST</option>"
									+ "<option value=\"09\">SEPTEMBER</option>"
									+ "<option value=\"10\">OCTOBER</option>"
									+ "<option value=\"11\">NOVEMBER</option>"
									+ "<option value=\"12\">DECEMBER</option>";
									
								if(search.containsKey("month") && search.get("month").length() > 0){
									html = html.replace("value=\"" + search.get("month") + "\"", "value=\"" + search.get("month") + "\" selected ");
								}
								
								out.println(html);
							%>
							</select>
						</div>
					</div>
					
				</div>
				
				<div class="span6">
					
					<div class="control-group">
						<label class="control-label">Daily</label>
						
						<div class="controls">
							<%
							html = "";
							if(search.containsKey("from_date")){
								html = search.get("from_date");
							}
							%>
							<input type="text" id="from_date" name="from_date" placeholder="eg. 23/01/2015" value="<%= html %>" />
							
							<%
							html = "";
							if(search.containsKey("to_date")){
								html = search.get("to_date");
							}
							%>
							<input type="text" id="to_date" name="to_date" placeholder="eg. 09/02/2015" value="<%= html %>" />
						</div>
					</div>
					
				</div>
			</div>
			
			<div class="row-fluid">
				<div class="span12 btn-control search">
					<button id="search_submit" name="search_submit" type="submit" class="btn">Search</button>
					<button id="search_clear" name="search_clear" type="submit" class="btn">Clear</button>
					<button id="export_submit" name="export_submit" type="submit" class="btn">Export</button>
				</div>
			</div>
			
		</form>
		
		<div style="width:1000px; overflow-x:auto">
		<table class="tblDetails" id="tblDetails"><thead>
		
			<tr>
				<th>Group Name</th>
				<th>Name of Staff</th>
				<th>Staff ID</th>
				<th>Total Applications</th>
<!-- 				<th>Credit Check Results Attached</th>
				<th>Credit Check Complete</th>
				<th>Pre-Update Validation Done</th>
				<th>Request Update Confirmation</th>
				<th>Update Done, Request Verification</th>
				<th>Verification Done</th>
				<th>Verified, Pending Document</th>
				<th>Total Work Count</th> -->
				
				<th>Credit Check Result attached</th>
				<th>Request Credit Check</th>
				<th>Incomplete Document</th>
				<th>Reject - Data Discrepancy</th>
				<th>Reject - Document Discrepancy</th>
				<th>Reject - Data and Document Discrepancy</th>
				<th>Credit Check Incomplete</th>
				<th>Request RMS Review (FRAUD)</th>
				<th>Recommended by RMS</th>
				<th>Not Recommended by RMS</th>
				<th>RMS Not Recommended, Request Decision</th>
				<th>Pre MID Setup Validation Done</th>
				<th>Data Discrepancy</th>
				<th>Doc Discrepancy</th>
				<th>Data & Doc Discrepancy</th>
				<th>Pending Original Doc</th>
				<th>Request Final Approval for MID Setup</th>
				<th>Pre MID Setup, Validation Done</th>
				<th>MID Setup Done . Request Verification</th>
				<th>Incomplete Doc. But Proceed for MID Setup</th>
				<th>Doc/ Info Provided. Request For MID Setup</th>
				<th>Incomplete. To Provide Doc/Info</th>
				<th>Amendment Required</th>
				<th>Amendment Done</th>
				<th>Verified. Filing Completed</th>
				<th>Verified. Pending Document</th>
				<th>Request For MID Setup</th>
				<th>Additional Document Received</th>
				<th>Total Work Count</th>
			</tr>
		</thead><tbody>
		<%
			int n = 0;
			for(TreeMap<String, String> c : (ArrayList<TreeMap<String, String>>) request.getAttribute("cArr")){
				//String case_url = request.getContextPath() + "/NewApp.do?dispatch=init&m_id=" + c.getMerchant().getId() + "&c_id=" + c.getId();
				
				html = "<tr class=" + (n % 2 > 0 ? "alt" : "even") + ">"
				+ "	<td>" + (c.get("role_name") != null ? Encode.forHtml(c.get("role_name")) : "") + "</td>"
				+ "	<td>" + (c.get("creator_name") != null ? Encode.forHtml(c.get("creator_name")) : "") + "</td>"
				+ "	<td>" + (c.get("creator") != null ? Encode.forHtml(c.get("creator")) : "") + "</td>"
				+ "	<td>" + (c.get("total_applications") != null ? Encode.forHtml(c.get("total_applications")) : "") + "</td>"
				+ "	<td>" + (c.get("col_1") != null ? Encode.forHtml(c.get("col_1")) : "") + "</td>"
				+ "	<td>" + (c.get("col_2") != null ? Encode.forHtml(c.get("col_2")) : "") + "</td>"
				+ " <td>" + (c.get("col_3") != null ? Encode.forHtml(c.get("col_3")) : "") + "</td>"
				+ " <td>" + (c.get("col_4") != null ? Encode.forHtml(c.get("col_4")) : "") + "</td>"
				+ " <td>" + (c.get("col_5") != null ? Encode.forHtml(c.get("col_5")) : "") + "</td>"
				+ " <td>" + (c.get("col_6") != null ? Encode.forHtml(c.get("col_6")) : "") + "</td>"
				+ " <td>" + (c.get("col_7") != null ? Encode.forHtml(c.get("col_7")) : "") + "</td>"
				+ " <td>" + (c.get("col_8") != null ? Encode.forHtml(c.get("col_8")) : "") + "</td>"
				+ " <td>" + (c.get("col_9") != null ? Encode.forHtml(c.get("col_9")) : "") + "</td>"
				+ " <td>" + (c.get("col_10") != null ? Encode.forHtml(c.get("col_10")) : "") + "</td>"
				+ " <td>" + (c.get("col_11") != null ? Encode.forHtml(c.get("col_11")) : "") + "</td>"
				+ " <td>" + (c.get("col_12") != null ? Encode.forHtml(c.get("col_12")) : "") + "</td>"
				+ " <td>" + (c.get("col_13") != null ? Encode.forHtml(c.get("col_13")) : "") + "</td>"
				+ " <td>" + (c.get("col_14") != null ? Encode.forHtml(c.get("col_14")) : "") + "</td>"
				+ " <td>" + (c.get("col_15") != null ? Encode.forHtml(c.get("col_15")) : "") + "</td>"
				+ " <td>" + (c.get("col_16") != null ? Encode.forHtml(c.get("col_16")) : "") + "</td>"
				+ " <td>" + (c.get("col_17") != null ? Encode.forHtml(c.get("col_17")) : "") + "</td>"
				+ " <td>" + (c.get("col_18") != null ? Encode.forHtml(c.get("col_18")) : "") + "</td>"
				+ " <td>" + (c.get("col_19") != null ? Encode.forHtml(c.get("col_19")) : "") + "</td>"
				+ " <td>" + (c.get("col_20") != null ? Encode.forHtml(c.get("col_20")) : "") + "</td>"
				+ " <td>" + (c.get("col_21") != null ? Encode.forHtml(c.get("col_21")) : "") + "</td>"
				+ " <td>" + (c.get("col_22") != null ? Encode.forHtml(c.get("col_22")) : "") + "</td>"
				+ " <td>" + (c.get("col_23") != null ? Encode.forHtml(c.get("col_23")) : "") + "</td>"
				+ " <td>" + (c.get("col_24") != null ? Encode.forHtml(c.get("col_24")) : "") + "</td>"
				+ " <td>" + (c.get("col_25") != null ? Encode.forHtml(c.get("col_25")) : "") + "</td>"
				+ " <td>" + (c.get("col_26") != null ? Encode.forHtml(c.get("col_26")) : "") + "</td>"
				+ " <td>" + (c.get("col_27") != null ? Encode.forHtml(c.get("col_27")) : "") + "</td>"
				+ " <td>" + (c.get("col_28") != null ? Encode.forHtml(c.get("col_28")) : "") + "</td>"
				+ "	<td>" + (c.get("total_work") != null ? Encode.forHtml(c.get("total_work")) : "")  + "</td>"
				+ "</tr>";
				
				out.println(html);
				++n;
			}
		%>
		</tbody></table>
		</div>
	</div>
</div>

<!-- Footer -->
<%@ include file="/jsp/common/Footer.jsp" %>	
<!-- End Footer -->


</body>
</html>
